<?php

/**
 * ListCounterCodes form base class.
 *
 * @package    erp-crm
 * @subpackage form
 * @author     Milwell H. Sia
 * @version    SVN: $Id: sfPropelFormGeneratedTemplate.php 12815 2008-11-09 10:43:58Z fabien $
 */
class BaseListCounterCodesForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'counter_code' => new sfWidgetFormInputHidden(),
      'ipaddress'    => new sfWidgetFormInput(),
    ));

    $this->setValidators(array(
      'counter_code' => new sfValidatorPropelChoice(array('model' => 'ListCounterCodes', 'column' => 'counter_code', 'required' => false)),
      'ipaddress'    => new sfValidatorString(array('max_length' => 50)),
    ));

    $this->validatorSchema->setPostValidator(
      new sfValidatorPropelUnique(array('model' => 'ListCounterCodes', 'column' => array('ipaddress')))
    );

    $this->widgetSchema->setNameFormat('list_counter_codes[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'ListCounterCodes';
  }


}
